/* vi:set ts=8 sts=4 sw=4:
 *
 * VIM - Vi IMproved	by Bram Moolenaar
 * 			CodeCheck extension by Birgi Tamersoy
 *				birgitamersoy@gmail.com
 *
 * Do ":help uganda"  in Vim to read copying and usage conditions.
 * Do ":help credits" in Vim to see a list of people who contributed.
 * See README.txt for an overview of the Vim source code.
 */

/*
 * concurrency.h: tools for running threads, etc.
 */

#ifndef VIM_CONCURRENCY_H_INCLUDED
#define VIM_CONCURRENCY_H_INCLUDED

typedef void* thread_handle_T;
typedef void* mutex_handle_T;

enum {
    THREAD_OK,
    THREAD_UNKNOWN
} thread_status_T;

thread_status_T create_thread( thread_handle_t handle, void* (*start_function)(void*), void* arg );
thread_status_T join_thread( thread_handle_T handle );

enum {
    MUTEX_OK,
    MUTEX_UNKNOWN
} mutex_status_T;

mutex_status_T create_mutex( mutex_handleT );
mutex_status_T lock_mutex( mutex_handle_T handle );
mutex_status_T trylock_mutex( mutex_handle_T handle );
mutex_status_T unlock_mutex( mutex_handle_T handle );
mutex_status_T destroy_mutex( mutex_handle_T handle );

#endif
